import{catelist}from "../../request/api.js"
const state ={
list:[]
}

const mutations={
    changeList(state,arr){
        state.list=arr
    }
}

const actions={
    asyncChangeList(context){
        catelist({istree:true}).then(res=>{
context.commit("changeList",res.data.list)
        })
   
    }
}

const getters={
    list(state){
        return state.list
    }
}

export default {
    state,mutations,actions,getters,
    namespaced:true

}